load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "mock",
    srcs = [
        "backend.go",
        "common.go",
        "encode.go",
        "importer.go",
        "mock_cluster.go",
        "s3iface.go",
        "task_register.go",
    ],
    importpath = "github.com/pingcap/tidb/br/pkg/mock",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/config",
        "//pkg/domain",
        "//pkg/kv",
        "//pkg/lightning/backend",
        "//pkg/lightning/backend/encode",
        "//pkg/lightning/common",
        "//pkg/lightning/verification",
        "//pkg/meta/model",
        "//pkg/server",
        "//pkg/session",
        "//pkg/store/mockstore",
        "//pkg/store/mockstore/teststore",
        "//pkg/types",
        "@com_github_aws_aws_sdk_go//aws/request",
        "@com_github_aws_aws_sdk_go//service/s3",
        "@com_github_go_sql_driver_mysql//:mysql",
        "@com_github_google_uuid//:uuid",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_kvproto//pkg/import_kvpb",
        "@com_github_pingcap_log//:log",
        "@com_github_tikv_client_go_v2//testutils",
        "@com_github_tikv_client_go_v2//tikv",
        "@com_github_tikv_pd_client//:client",
        "@com_github_tikv_pd_client//http",
        "@io_opencensus_go//stats/view",
        "@org_golang_google_grpc//:grpc",
        "@org_golang_google_grpc//metadata",
        "@org_uber_go_mock//gomock",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "mock_test",
    timeout = "short",
    srcs = ["mock_cluster_test.go"],
    flaky = True,
    deps = [
        ":mock",
        "@com_github_stretchr_testify//require",
        "@org_uber_go_goleak//:goleak",
    ],
)
